[−][src]Crate rand_distr
Generating random samples from probability distributions.
Re-exports
This crate is a super-set of the rand::distributions
module. See the
rand::distributions
module documentation for an overview of the core
Distribution
trait and implementations.
The following are re-exported:
- The
Distribution
trait andDistIter
helper type - The
Standard
,Alphanumeric
,Uniform
,OpenClosed01
,Open01
,Bernoulli
, andWeightedIndex
distributions
Distributions
This crate provides the following probability distributions:
- Related to real-valued quantities that grow linearly
(e.g. errors, offsets):
Normal
distribution, andStandardNormal
as a primitiveCauchy
distribution
- Related to Bernoulli trials (yes/no events, with a given probability):
Binomial
distribution
- Related to positive real-valued quantities that grow exponentially
(e.g. prices, incomes, populations):
LogNormal
distribution
- Related to the occurrence of independent events at a given rate:
- Gamma and derived distributions:
Gamma
distributionChiSquared
distributionStudentT
distributionFisherF
distribution
- Triangular distribution:
Beta
distributionTriangular
distribution
- Multivariate probability distributions
Dirichlet
distributionUnitSphere
distributionUnitBall
distributionUnitCircle
distributionUnitDisc
distribution
- Misc. distributions
InverseGaussian
distributionNormalInverseGaussian
distribution
Re-exports
pub use weighted_alias::WeightedAliasIndex; |
pub use num_traits; |
Modules
uniform | A distribution uniformly sampling numbers within a given range. |
weighted_alias | This module contains an implementation of alias method for sampling random indices with probabilities proportional to a collection of weights. |
Structs
Alphanumeric | Sample a |
Bernoulli | The Bernoulli distribution. |
Beta | The Beta distribution with shape parameters |
Binomial | The binomial distribution |
Cauchy | The Cauchy distribution |
ChiSquared | The chi-squared distribution |
Dirichlet | The Dirichlet distribution |
DistIter | An iterator that generates random values of |
Exp | The exponential distribution |
Exp1 | Samples floating-point numbers according to the exponential distribution,
with rate parameter |
FisherF | The Fisher F distribution |
Gamma | The Gamma distribution |
InverseGaussian | |
LogNormal | The log-normal distribution |
Normal | The normal distribution |
NormalInverseGaussian | |
Open01 | A distribution to sample floating point numbers uniformly in the open
interval |
OpenClosed01 | A distribution to sample floating point numbers uniformly in the half-open
interval |
Pareto | Samples floating-point numbers according to the Pareto distribution |
Pert | The PERT distribution. |
Poisson | The Poisson distribution |
Standard | A generic random value distribution, implemented for many primitive types. Usually generates values with a numerically uniform distribution, and with a range appropriate to the type. |
StandardNormal | Samples floating-point numbers according to the normal distribution
|
StudentT | The Student t distribution, |
Triangular | The triangular distribution. |
Uniform | Sample values uniformly between two bounds. |
UnitBall | Samples uniformly from the unit ball (surface and interior) in three dimensions. |
UnitCircle | Samples uniformly from the edge of the unit circle in two dimensions. |
UnitDisc | Samples uniformly from the unit disc in two dimensions. |
UnitSphere | Samples uniformly from the surface of the unit sphere in three dimensions. |
Weibull | Samples floating-point numbers according to the Weibull distribution |
WeightedIndex | A distribution using weighted sampling to pick a discretely selected item. |
Enums
BernoulliError | Error type returned from |
BetaError | Error type returned from |
BinomialError | Error type returned from |
CauchyError | Error type returned from |
ChiSquaredError | Error type returned from |
DirichletError | Error type returned from |
ExpError | Error type returned from |
FisherFError | Error type returned from |
GammaError | Error type returned from |
InverseGaussianError | Error type returned from |
NormalError | Error type returned from |
NormalInverseGaussianError | Error type returned from |
ParetoError | Error type returned from |
PertError | Error type returned from |
PoissonError | Error type returned from |
TriangularError | Error type returned from |
WeibullError | Error type returned from |
WeightedError | Error type returned from |
Traits
Distribution | Types (distributions) that can be used to create a random instance of |